home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et3_0-a1.lha / et3 / src / PathLookup.h < prev    next >
C/C++ Source or Header  |  1992-04-27  |  715b  |  36 lines

  1. #ifndef PathLookup_First
  2. #ifdef __GNUG__
  3. //pragma once
  4. #pragma interface
  5. #endif
  6. #define PathLookup_First
  7.  
  8. #include "Object.h"
  9.  
  10. //---- class PathLookup -----------------------------------------------------
  11.  
  12. class PathLookup: public Object {
  13. friend class PathIter;
  14. protected:
  15.     char *path;
  16.     class OrdCollection *paths;
  17.     virtual void Scan();
  18. public:
  19.     MetaDef(PathLookup);
  20.     PathLookup(char *path);                   // eg. "/bin:/tmp:/usr/bin"
  21.     ~PathLookup();
  22.     bool Lookup(const char *file, char *buf); // returns in buf the path to file
  23.     void Add(char *);
  24. };
  25.  
  26. class PathIter {
  27.     class Iterator *ip;
  28. public:
  29.     PathIter(PathLookup *p);
  30.     ~PathIter();
  31.     char *operator()();
  32. };
  33.     
  34. #endif
  35.  
  36.